let state = {
  innerWidth: 800,
  innerHeight: 600,
};
let getters = {
  innerWidth: (state) => state.innerWidth,
  innerHeight: (state) => state.innerHeight,
};
let mutations = {
  setInnerWidth(state, innerWidth) {
    // 设置名称
    state.innerWidth = innerWidth;
  },
  setInnerHeight(state, innerHeight) {
    // 设置域名
    state.innerHeight = innerHeight;
  },
};
let actions = {
  testActions({ commit }, num) {
    setTimeout(() => {
      commit("setTotal", num);
      console.log(num);
    }, 2000);
  },
  innerWidthActions({ commit }, innerWidth) {
    //console.log("innerWidthActions");
    commit("setInnerWidth", innerWidth);
  },
  innerHeightActions({ commit }, innerHeight) {
    //console.log("innerHeightActions");
    commit("setInnerHeight", innerHeight);
  },
};
export default { state, getters, mutations, actions };
